/**
 *
 */
package com.zhengtoon.mctoon.conv.service;

import com.zhengtoon.mctoon.conv.dao.ConvRemindRecordMapper;
import com.zhengtoon.mctoon.conv.service.ConvRemindRecordService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 小红点 impl实现
 *
 * @author 赵康峰
 * @since 2017-06-22
 * Copyright: Copyright (c) 2017
 * Company:北京政务通科技有限公司
 */
@Service
public class ConvRemindRecordServiceImpl implements ConvRemindRecordService {

    @Autowired
    private ConvRemindRecordMapper convRemindRecordMapper;

    @Override
    public Boolean queryCommentStatus(String userId) {
        int count = convRemindRecordMapper.queryUserRemindCount(userId);
        if (count == 0) {
            return false;
        }
        Long commentSum = convRemindRecordMapper.getCommentStatus(userId);
        if (commentSum > 0) {
            return true;
        }
        Long handleRecordSum = convRemindRecordMapper.getHandleRecordStatus(userId);
        return handleRecordSum > 0;
    }
}